import Middle from "./Middle"
import {createContext} from "react";
function Top(){
    const context={
        content:"我是从顶层组件传递的数据"
    }
    return <Top.Context.Provider value={context}>
        <h1>我是顶层组件</h1>
        <Middle></Middle>
    </Top.Context.Provider>
}
// 创建一个Context
Top.Context = createContext({content:"default"});

export default Top